//
//  MusicMusicDefualtCell.swift
//  NDAi
//
//  Created by 丸子 on 2024/7/25.
//

import UIKit

class MusicMusicDefualtCell: UITableViewCell {
    
    private lazy var backView: UIView = {
       let view = UIView()
        view.backgroundColor = .white
        view.allRound(10)
        return view
    }()
    
    private lazy var iconIV: UIImageView = {
       let imageView = UIImageView()
        imageView.image = UIImage(named: "icon_music-def")
        return imageView
    }()
    
    private lazy var moreIV: UIImageView = {
       let imageView = UIImageView()
        imageView.image = UIImage(named: "icon_Mine_更多")
        return imageView
    }()
    
    private lazy var titleLb:UILabel = {
       let label = UILabel()
        label.textColor = Theme.color.text_d2
        label.font = UIFont.pingFangSCRegular(ofSize: 14)
        return label
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        backgroundColor = .clear
        contentView.addSubview(backView)
        selectionStyle = .none
        backView.addSubviews([iconIV, titleLb, moreIV])
        
        backView.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(10)
            make.leading.trailing.equalToSuperview().inset(14)
            make.height.equalTo(58)
            make.bottom.equalToSuperview()
        }
        self.parentViewController
        iconIV.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.leading.equalTo(14)
            make.width.height.equalTo(36)
        }
        
        moreIV.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.trailing.equalToSuperview().offset(-16)
            make.width.equalTo(6)
            make.height.equalTo(10)
        }
        
        titleLb.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.leading.equalTo(iconIV.snp.trailing).offset(10)
            make.trailing.equalTo(moreIV.snp.leading).offset(-10)
        }
        
    }
    
    
    func setup(model:MusicModel){
        self.titleLb.text = model.lyric_desc ?? ""
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    
    
   
}
